package com.example.demo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.List;

@Data
public class FeatureTemplateClassGenerateReq {

    private String parentClazz;

    @NotBlank(message = "clazz字段不能为空")
    private String clazz;
    private List<BeanFieldTemplate> fields;
    private List<AnnotationTemplate> annotations;

    @Data
    public static class BeanFieldTemplate {
        @NotBlank(message = "字段名fieldName不能为空")
        private String fieldName;
        @NotBlank(message = "字段类型type不能为空")
        private String type;
        private String defaultValue;
        private List<AnnotationTemplate> annotations;

    }

    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AnnotationTemplate {
        @NotBlank(message = "注解类型annotationType不能为空")
        private String annotationType;
        private List<AnnotationParam> paramArray;

        @Data
        @Builder
        @AllArgsConstructor
        @NoArgsConstructor
        public static class AnnotationParam {
            @NotBlank(message = "注解参数值名称valueName不能为空")
            private String valueName;
            @NotBlank(message = "注解参数值类型valueType不能为空")
            private String valueType;
            @NotBlank(message = "注解参数值value不能为空")
            private String value;
        }
    }
}
